home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pdcurs21.zip
/
PORTABLE.ZIP
/
ENDWIN.C
< prev
next >
Wrap
Text File
|
1992-11-21
|
3KB
|
85 lines
#define CURSES_LIBRARY 1
#include <curses.h>
#undef endwin
#ifndef NDEBUG
char *rcsid_endwin = "$Header: c:/curses/portable/RCS/endwin.c%v 2.0 1992/11/15 03:28:46 MH Rel $";
#endif
/*man-start*********************************************************************
endwin() - restore initial terminal environment
X/Open Description:
A program should always call endwin() before exiting or
escaping from curses mode temporarily. This routine will
restore tty modes, move the cursor to the lower left corner
of the screen and reset the terminal into the proper non-visual
mode. To resume curses after a temporary escape, refresh() or
doupdate() should be called.
PDCurses Description:
At this time, endwin() must be followed by a call to initscr()
for temporary escapes.
In addition, endwin() will resize the screen, if necessary.
X/Open Return Value:
The endwin() function returns OK on success and ERR on error.
X/Open Errors:
No errors are defined for this function.
Portability:
PDCurses int endwin( void );
X/Open Dec '88 int endwin( void );
BSD Curses
SYS V Curses
**man-end**********************************************************************/
int endwin(void)
{
PDC_scr_close();
/* resetty();*/
if (_cursvar.orig_font != _cursvar.font) /* screen has not been resized */
{
PDC_set_font(_cursvar.orig_font);
resize(PDC_get_rows());
}
_cursvar.visible_cursor = FALSE; /* Force the visible cursor */
_cursvar.cursor = _cursvar.orig_cursor;
curson();
#if 0
_cursvar.blank = ' '; /* Reset blank char to a space */
wmove(stdscr, 0, 0); /* Ensure full window clear */
wclrtobot(stdscr);
wrefresh(stdscr);
#endif
delwin(stdscr);
delwin(curscr);
delwin(tmpwin);
stdscr = (WINDOW *)NULL;
curscr = (WINDOW *)NULL;
tmpwin = (WINDOW *)NULL;
_cursvar.alive = FALSE;
/*
* Position cursor so that the screen will not scroll until they hit
* a carriage return.
*/
PDC_gotoxy(PDC_get_rows() - 2, 0);
#ifdef FLEXOS
_flexos_8bitmode();
#endif
/* PDC_fix_cursor(_cursvar.orig_emulation);*/
if (_cursvar.orig_font != _cursvar.font) /* screen has not been resized */
reset_shell_mode();
return( OK );
}